package de.fh.ka.as.car.drivecontrol.model;

public class Control {
	/**
	 * Range -1 to 1; Values below 0 means drive backwards.
	 */
	private double speed;

	/**
	 * Range -1 to 1; Left: -1, Right: 1, Forward: 0.
	 */
	private double steering;

	/**
	 * <code>true</code> means brake.
	 */
	private boolean brake;

	private boolean horn;

	private boolean lightLeft;
	private boolean lightRight;

	public Control(double speed, double drive, boolean brake) {
		this.speed = speed;
		this.steering = drive;
		this.brake = brake;
	}

	public Control(double speed, double drive, boolean brake, boolean horn) {
		this(speed, drive, brake);
		this.horn = horn;
	}

	public Control(double speed, double drive) {
		this(speed, drive, false);
	}

	public Control() {
		this.speed = 0;
		this.steering = 0;
		this.brake = false;
	}

	public double getSpeed() {
		return speed;
	}

	public void setSpeed(double speed) {
		this.speed = speed;
	}

	public double getSteering() {
		return steering;
	}

	public void setSteering(double steering) {
		this.steering = steering;
	}

	public boolean isBrake() {
		return brake;
	}

	public void setBrake(boolean brake) {
		this.brake = brake;
	}

	@Override
	public String toString() {
		return String.format("Control: speed=%s steering=%s brake=%s hlights=(%s, %s)", speed + "", steering
				+ "", brake + "", lightLeft, lightRight);
	}

	public boolean isHorn() {
		return horn;
	}

	public void setHorn(boolean horn) {
		this.horn = horn;
	}

	public boolean isLightLeft() {
		return lightLeft;
	}

	public void setLightLeft(boolean lightLeft) {
		this.lightLeft = lightLeft;
	}

	public boolean isLightRight() {
		return lightRight;
	}

	public void setLightRight(boolean lightRight) {
		this.lightRight = lightRight;
	}

}
